com.highdeal.pnr.hci
Class ComponentProperty

java.lang.Object
  extended by com.highdeal.pnr.hci.ComponentProperty
All Implemented Interfaces:
XMLMarshallable

public class ComponentProperty
extends java.lang.Object
implements XMLMarshallable

This Java class is a Helper class to marshal and unmarshal all the rating components.

See Also:
Property

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:simpleType name="componentPropertyType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="number"/>
      <xs:enumeration value="decimal"/>
      <xs:enumeration value="string"/>
      <xs:enumeration value="date"/>
      <xs:enumeration value="money"/>
      <xs:enumeration value="boolean"/>
   </xs:restriction>
 </xs:simpleType>
  <xs:element name="property">
   <xs:complexType>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="type" type="componentPropertyType"/>
    <xs:attribute name="value" type="xs:string"/>
    <xs:attribute name="propertyNameValue" type="xs:boolean" default="false"/>
   </xs:complexType>
  </xs:element>


Field Summary
static int TYPE_BOOLEAN
          Constant for property type boolean.
static int TYPE_DATE
          Constant for property type date.
static int TYPE_MONEY
          Constant for property type money.
static int TYPE_NUMBER
          Constant for property type number.
static int TYPE_STRING
          Constant for property type string.
 
Constructor Summary
ComponentProperty()
          Constructs an empty component property.
ComponentProperty(java.lang.String name, int type, java.lang.Object value, boolean isPropertyNameValue)
          Build the ComponentProperty from the given parameters.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 boolean getBooleanValue()
          Returns the value of the component property as a boolean.
 java.util.Date getDateValue()
          Returns the value of the component property as a date.
 java.math.BigDecimal getDecimalValue()
          Returns the value of the component property as a decimal.
 Money getMoneyValue()
          Returns the value of the component property as a money.
 java.lang.String getName()
          Returns the name of the component property.
 java.lang.String getPropertyNameValue()
          Returns the value of the component property as a property name.
 java.lang.String getStringValue()
          Returns the value of the component property as a string.
 int getType()
          Returns the type of the component property.
 java.lang.Object getValue()
          Get the value of the component property as an object.
 boolean isPropertyNameValue()
          Whether the property value is a property name
 void isPropertyNameValue(boolean isPropertyNameValue)
          Set whether the component property is pointing to a property.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void marshal(XMLOutputter output, java.lang.String fullName)
           
static void marshal(XMLOutputter output, java.lang.String name, java.math.BigDecimal value)
          Helper static method to marshall a component property of type decimal.
static void marshal(XMLOutputter output, java.lang.String name, boolean value)
          Helper static method to marshall a component property of type boolean.
static void marshal(XMLOutputter output, java.lang.String name, java.util.Date value)
          Helper static method to marshall a component property of type date.
static void marshal(XMLOutputter output, java.lang.String name, Money value)
          Helper static method to marshall a component property of type money.
static void marshal(XMLOutputter output, java.lang.String name, java.lang.String value)
          Helper static method to marshall a component property of type string.
static void marshal(XMLOutputter output, java.lang.String name, java.lang.String value, int type)
          Helper static method to marshall a component property of any type with a value which is a name property.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setBooleanValue(boolean booleanValue)
          Set the value of the component property with a boolean.
 void setDateValue(java.util.Date dateValue)
          Set the value f the component property with a date.
 void setDecimalValue(java.math.BigDecimal decimalValue)
          Set the value of the component property with a decimal.
 void setMoneyValue(Money moneyValue)
          Set the value of the component property with a money.
 void setName(java.lang.String name)
          Set the component property name.
 void setPropertyNameValue(java.lang.String propertyNameValue)
          Set the value of the component property with a property name.
 void setStringValue(java.lang.String stringValue)
          Set the value of the component property with a string.
 void setType(int type)
          Set the component property type.
 void setValue(java.lang.Object value)
          Set the value of the component property with an object.
 Property toProperty()
          Convert the ComponentProperty to a Property.
static java.lang.String translate(java.lang.String propertyName)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STRING

public static final int TYPE_STRING
Constant for property type string.

See Also:
Constant Field Values

TYPE_NUMBER

public static final int TYPE_NUMBER
Constant for property type number.

See Also:
Constant Field Values

TYPE_DATE

public static final int TYPE_DATE
Constant for property type date.

See Also:
Constant Field Values

TYPE_MONEY

public static final int TYPE_MONEY
Constant for property type money.

See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
Constant for property type boolean.

See Also:
Constant Field Values
Constructor Detail

ComponentProperty

public ComponentProperty()
Constructs an empty component property.


ComponentProperty

public ComponentProperty(java.lang.String name,
                         int type,
                         java.lang.Object value,
                         boolean isPropertyNameValue)
Build the ComponentProperty from the given parameters.

Method Detail

getName

public java.lang.String getName()
Returns the name of the component property.

Returns:
The name of the component property

setName

public void setName(java.lang.String name)
Set the component property name.

Parameters:
name - The new name of the component property

getStringValue

public java.lang.String getStringValue()
Returns the value of the component property as a string.

Returns:
The value of the component property as a string

setStringValue

public void setStringValue(java.lang.String stringValue)
Set the value of the component property with a string.

Parameters:
stringValue - The value to set up

getDecimalValue

public java.math.BigDecimal getDecimalValue()
Returns the value of the component property as a decimal.

Returns:
The value of the component property as a decimal

setDecimalValue

public void setDecimalValue(java.math.BigDecimal decimalValue)
Set the value of the component property with a decimal.

Parameters:
decimalValue - The value to set up

getDateValue

public java.util.Date getDateValue()
Returns the value of the component property as a date.

Returns:
The value of the component property as a date

setDateValue

public void setDateValue(java.util.Date dateValue)
Set the value f the component property with a date.

Parameters:
dateValue - The value to set up

getMoneyValue

public Money getMoneyValue()
Returns the value of the component property as a money.

Returns:
The value of the component property as a money

setMoneyValue

public void setMoneyValue(Money moneyValue)
Set the value of the component property with a money.

Parameters:
moneyValue - The value to set up

getBooleanValue

public boolean getBooleanValue()
Returns the value of the component property as a boolean.

Returns:
The value of the component property as a boolean

setBooleanValue

public void setBooleanValue(boolean booleanValue)
Set the value of the component property with a boolean.

Parameters:
booleanValue - The value to set up

getPropertyNameValue

public java.lang.String getPropertyNameValue()
Returns the value of the component property as a property name.

Returns:
The value of the component property as a property name

setPropertyNameValue

public void setPropertyNameValue(java.lang.String propertyNameValue)
Set the value of the component property with a property name.

Parameters:
propertyNameValue - The value to set up

getValue

public java.lang.Object getValue()
Get the value of the component property as an object.

Returns:
The component property value

setValue

public void setValue(java.lang.Object value)
Set the value of the component property with an object.

Parameters:
value - The value to set up

isPropertyNameValue

public boolean isPropertyNameValue()
Whether the property value is a property name

Returns:
Whether the property value is a property name

isPropertyNameValue

public void isPropertyNameValue(boolean isPropertyNameValue)
Set whether the component property is pointing to a property.

Parameters:
isPropertyNameValue - Whether the component property is pointing to a property

getType

public int getType()
Returns the type of the component property.

Returns:
The type of the component property

setType

public void setType(int type)
Set the component property type.

Parameters:
type - The type to set up

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshal

public void marshal(XMLOutputter output,
                    java.lang.String fullName)

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           java.lang.String value)
Helper static method to marshall a component property of type string.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           java.util.Date value)
Helper static method to marshall a component property of type date.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           java.math.BigDecimal value)
Helper static method to marshall a component property of type decimal.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           Money value)
Helper static method to marshall a component property of type money.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           boolean value)
Helper static method to marshall a component property of type boolean.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property

marshal

public static void marshal(XMLOutputter output,
                           java.lang.String name,
                           java.lang.String value,
                           int type)
Helper static method to marshall a component property of any type with a value which is a name property.

Parameters:
output - The XML outputter where the output has to go
name - The name of the property
value - The value of the property (the property name to which the current property is pointing)
type - The type of the property

translate

@Deprecated
public static java.lang.String translate(java.lang.String propertyName)
Deprecated. 

Parameters:
propertyName -

toProperty

public Property toProperty()
                    throws java.lang.IllegalArgumentException
Convert the ComponentProperty to a Property.

Returns:
The Property results from the conversion
Throws:
java.lang.IllegalArgumentException - throws if the type of the ComponentProperty is not TYPE_DATE, TYPE_NUMBER neither TYPE_STRING

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)